<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="../lib/js/vue.js"></script>
  <title>Document</title>
</head>
<body>
  <div id="root">
    <img :src="phc" alt="">
    <button @click="pre">第一张</button>
    <button @click="dev">第二张</button>
  </div>
  <script type="text/javascript">
       const vm=new Vue({
          el:'#root',
          data:function(){
            return{
              phc:'../img/image1.jpg'
            }

          },
          methods:{
             pre:function(){
this.phc='../img/image1.jpg'
             },
             dev:function(){
this.phc='../img/image2.jpg'
             }
          }
        })
      </script>
</body>
</html>